import { observable, action, makeObservable } from 'mobx';

class Todo {
  constructor() {
    // mobx6.0后的版本都需要手动调用makeObservable(this)，不然会发现数据变了视图不更新
    makeObservable(this); 
  }
  @observable testValue = '123'
  @observable testValue2 = 'testValue2'

  @action
  finsh(value: string) {
    this.testValue = value
  }

  @action
  change2(value: string) {
    this.testValue2 = value
  }
}
const todoStore = new Todo();
export default todoStore;
